package com.future.lock.home.entity.response;

import com.future.lock.common.http.response.HttpResponse;
import com.future.lock.home.entity.bean.GateWay;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/12/25 0025.
 */

public class GatewayListResponse extends HttpResponse {

    public List<GateWay> gateWays;

    @Override
    protected void parseData(String dataString) throws JSONException {
        JSONArray array = new JSONArray(dataString);
        gateWays = new ArrayList<>();
        for (int i = 0; i < array.length(); i++) {
            GateWay gateWay = new GateWay();
            gateWay.parse(array.optJSONObject(i));
            gateWays.add(gateWay);
        }
    }
}
